package com.my.thread;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/2/17 19:52
 */
public class ThreadTest {
    public static void main(String[] args) {
        //在mian 线程（主线程）中创建了2个子线程 peopleA，peopleB
        PeopleA peopleA = new PeopleA();
        PeopleB peopleB = new PeopleB();
        //给子线程取个名字
        peopleA.setName("提问者");
        peopleB.setName("回答者");
        //启动peopleA，peopleB线程，启动后系统将增加一个线程去执行run方法里的代码
        peopleA.start();
        peopleB.start();
        //打印这句表示主线程启动子线程后，会继续执行后续代码，不会关心子线程什么时候执行
        System.out.println("main函数结束了。");
    }

}
